package com.muchfish.reactor.api;

import reactor.core.publisher.Flux;

public class ReactorFilterExample {
    public static void main(String[] args) {
        Flux<Integer> source = Flux.range(1, 5);

        // 筛选偶数
        Flux<Integer> evenNumbers = source.filter(x -> x % 2 == 0);

        evenNumbers.subscribe(System.out::println); // 输出: 2, 4
    }
}

